package com.atguigu.juc;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author ：MJS
 * @date ：Created in 2021/4/25  20:45
 * @description：TODO
 */
public class CallableOfLambda {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask futureTask = new FutureTask(()->{
            System.out.println("嘿嘿");
            return "hello java";
        });
        Thread thread = new Thread(futureTask, "张三");
        thread.start();
        System.out.println(Thread.currentThread().getName()+"\t"+"insert in");
      System.out.println(futureTask.get());


    }
}


